package com.huang.PC;

import java.util.concurrent.TimeUnit;

public class case1 {
    public static void main(String[] args) {
        Object o = new Object();

        new Thread(()->{
            synchronized (o){
                try {
                    o.wait();
                    System.out.println("唤醒了");
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }).start();
        new Thread(()->{

            synchronized (o) {
                System.out.println("无关线程");
            }
        }).start();

        new Thread(()->{
            synchronized (o) {
                o.notify();
                System.out.println("去唤醒。。。");
            }
        }).start();
    }
}
